<template>
  <div id="equList">
    <el-table :data="tableData" :stripe="true" style="width: 100%">
      <el-table-column prop="id" label="器材编号" align="center">
      </el-table-column>
      <el-table-column prop="equipmentName" label="器材名称" align="center">
      </el-table-column>
      <el-table-column prop="equipmentClass" label="器材类型" align="center">
      </el-table-column>
      <el-table-column label="是否维修" align="center">
        <template slot-scope="scope">{{scope.row.state==1?'是':'否'}}</template>
      </el-table-column>
    </el-table>
    <div class="footer">
      <el-pagination
        layout="prev, pager, next"
        @current-change="pageBtn"
        :page-size="count"
        :total="total"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      page: 1,
      count: 5,
      total: 10,
      tableData: [],
    };
  },
  methods: {
    render: function () {
      this.$axios({
        url: "/equipment/list/equipmentlist",
        params: {
          id:this.$store.state.yqy.equManSee.id,
          limit: this.count,
          page: this.page,
        },
      }).then(({ data }) => {
        if (data.code == 0) {
          this.tableData = data.data;
          this.total = data.total;
        } else {
          this.$message.error("数据加载失败!");
        }
      });
    },
    pageBtn: function (v) {
      this.page = v;
      this.render();
    },
  },
  mounted: function () {
    this.render();
  },
};
</script>

<style scoped lang="less">
#equList {
  padding-bottom: 30px;
}
.footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
}
</style>